﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Nody
{
    public class Inventory
    {
        #region Properties

        public List<Item> Items { get { return items; } }
        List<Item> items;
        public bool isLoaded = false;
        
        #endregion

        #region Public methods

        public Inventory()
        {
            items = new List<Item>();
        }
        
        public void AddItem(Item i)
        {
            items.Add(i);
            if (this.isLoaded && !i.isLoaded)
                i.LoadContent();
        }

        public void RemoveItem(Item i)
        {
            items.Remove(i);
        }

        public void LoadContent()
        {
            foreach (Item i in items)
                i.LoadContent();
            isLoaded = true;
        }

        #endregion

    }
}
